import java.util.Scanner;

public class Main5 {
    public static void main(String[] args) {
        Scanner num = new Scanner(System.in);
        int n = num.nextInt();
        int k = num.nextInt();
        int[] arr = new int[n];
        for (int i = 0; i < n; i++) {
            arr[i] = num.nextInt();
        }

        for (int i = 0; i < n; i++) {
            int temp = arr[i];
            int flag = 0;
            for (int j = 0; j < n; j++) {
                if (temp == arr[j]) {
                    flag++;
                }
            }

            if (flag == 1) {
                System.out.println(temp);
                break;
            }
        }
    }
}
